package im.eg.service.util;

import cn.hutool.core.util.CharUtil;
import cn.hutool.core.util.StrUtil;

public class EgStrUtil {
    public static String className2beanName(String beanName) {
        if (StrUtil.isBlank(beanName)) {
            throw new RuntimeException("invalid arg 'beanName'");
        }
        char firstChar = beanName.charAt(0);
        if (CharUtil.isLetterUpper(firstChar)) {
            return String.valueOf((char) ((int) firstChar + 0x20)) + beanName.substring(1);
        } else {
            return beanName;
        }
    }

}
